<?php
namespace app\admin\controller;


class Groups extends \app\common\controller\Base {
	protected $modelname='Group';
	protected $_AllowRecache=true;

	public function _index(){
		$userInfo=$GLOBALS['userInfo'];
		$gids=$userInfo['gids'];
		$condition = [];

		if (!in_array(0,$gids)) {
			$groupModel=model("Group");
			$t=array_unique($groupModel->getAllChild($gids));
			$condition[] = ['id','in', $t];
		}
		return $condition;
	}

	protected function recache() {
		\think\facade\Cache::clear('GROUP_ACCESS');
		\think\facade\Cache::clear('USER_MENU');
		\think\facade\Cache::clear('ModelCache_Menu');
	}
}


?>